﻿create procedure dbo.GetCurrentOrder
(
		@TakeoutUserID int
	)

AS
	
	
	SELECT     dbo.TakeoutUser.IsPaid, dbo.TakeoutUser.Instructions, dbo.TakeoutUser.OrderTime, dbo.TakeoutUser.FundsSecuredTime, dbo.TakeoutUser.OrderTotal, 
	                      dbo.OrderItems.Quantity, dbo.OrderItems.MenuItemID, dbo.OrderItems.Id AS OrderItemID, dbo.MenuItems.Description, dbo.MenuItems.Price, 
	                      dbo.MenuItems.PrepTimeMinutes
	FROM         dbo.OrderItems INNER JOIN
	                      dbo.TakeoutUser ON dbo.OrderItems.TakeoutUserId = dbo.TakeoutUser.Id INNER JOIN
	                      dbo.MenuItems ON dbo.OrderItems.MenuItemID = dbo.MenuItems.Id
	WHERE     (dbo.TakeoutUser.Id = @TakeoutUserID)
	
	RETURN


